<html>
<body><?php
if (isset($_REQUEST['email']))
//if "SMS form" is filled out, send email
  {
  //send email
  $to = $_REQUEST['email'] ; 
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail( "$to@sms.mobitel.lk", "$subject",
  $message, "**Mayu's sms widget**" );
  echo "Thank you for using Mobitel SMS widget";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mail.php'>
  mobile number(e.g 94712598745): <input name='email' type='text' /><br />
  Name: <input name='subject' type='text' /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?><br>
<a href="sms.html">Send another SMS to mobitel</a></body>
</html> 
